#include "form.h"
#include "ui_form.h"
#include <qfiledialog.h>

Form::Form(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Form)
{
    ui->setupUi(this);
    d_color = new ColorPlot();
    int row = ui->tableWidget->rowCount();
    int column = ui->tableWidget->columnCount();
    for(int i = 0; i < row; i++)
    {
        for(int j = 0 ; j < column ; j++)
        {
            QTableWidgetItem *item = ui->tableWidget->item(i,j);
            item->setBackground(QBrush(d_color->setColor(d_color->getGroup(i,j)),Qt::SolidPattern));
        }
    }
}

Form::~Form()
{
    delete ui;
    delete d_color;
}
